//
//  DirectCommand.m
//  LSM
//
//  Created by Léo Lego on 13/05/12.
//  Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//

#import "DirectCommand.h"
#import "ServicesManager.h"
@interface DirectCommand ()

@end

@implementation DirectCommand
@synthesize panel;
@synthesize commandField;

-(id) initWithWindowNibName:(NSString *)windowNibName AndMother:(id)Mother{
	if(self = [super initWithWindowNibName:windowNibName]){
		NSLog(@"INIT Command");
		mother = Mother;
	}
	return  self;
}

- (IBAction)sendButton:(id)sender {
	if(commandField.stringValue.length != 0){
		[mother fullCommandWithCommand:commandField.stringValue];
		[panel setIsVisible:NO];
	} else {
		NSAlert * alert = [[NSAlert alloc] init];
		[alert setMessageText:@"Empty command !"];
		[alert runModal];
	}

}
@end
